﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Pub.Tools;
using Pub.Lib;

namespace MyAPP
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btncheckad_Click(object sender, EventArgs e)
        {
            string strmess = string.Empty;
            if (ADTools.ADAuthUser("dw", txtUser.Text, txtpass.Text, ref strmess))
            {
                MsgTools.InfoMsg("T");
            }
            else
            {
                MsgTools.InfoMsg(strmess);
            }
        }

        private void btnchangepass_Click(object sender, EventArgs e)
        {
            string strmess = string.Empty;
            if (ADTools.ADChangeUserPasswd("dw", txtUser.Text, txtNew.Text, txtpass.Text, ref strmess))
            {
                MsgTools.InfoMsg("OK");
            }
            else
            {
                MsgTools.InfoMsg(strmess);
            }         
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string cc = string.Empty;
            string ss = Pub.Tools.SysTools.GetVer();
            MsgTools.InfoMsg(ss);

        }

        private void button2_Click(object sender, EventArgs e)
        {
         //   string aa = Helper.DBHelper.GetLocalInf("dd");

            DataTable dt1 = Helper.DBHelper.GetDataTable("select id,cClassName,ParentID from dbo.CusClass");
            DBClass.MakeTree("0", "地区", treeView2, dt1);

            DataTable dt = Helper.DBHelper.GetDataTable("select cClassCode,cClassName from dbo.CusClass Order by cClassCode");
            DBClass.MakeTree("", "地区", treeView1, dt);
  
        }
    }
}
